package com.maybach.workflow.common.api;


import com.maybach.workflow.common.api.enums.FlowTypeEnum;
import com.maybach.workflow.common.api.node.BaseNode;

import java.util.HashMap;
import java.util.Map;

/**
 * Created by well on 15/6/11.
 */
public class FlowChain {

    private String displayName;
    private String name;
    private String expression;

    private Integer version;

    private Integer order = 999;
    /**
     * 流程详情链接
     */
    private String url;

    public String getUrl() {
        return url;
    }

    public void setUrl(String url) {
        this.url = url;
    }

    private FlowTypeEnum flowTypeEnum;

    public Integer getOrder() {
        return order;
    }

    public void setOrder(Integer order) {
        this.order = order;
    }

    Map<String,BaseNode> map = new HashMap<String,BaseNode>();

    public Map<String, BaseNode> getMap() {
        return map;
    }

    public BaseNode getBaseNode(String name){
        return map.get(name);
    }

    public void setMap(Map<String, BaseNode> map) {
        this.map = map;
    }

    public String getDisplayName() {
        return displayName;
    }

    public void setDisplayName(String displayName) {
        this.displayName = displayName;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getExpression() {
        return expression;
    }

    public void setExpression(String expression) {
        this.expression = expression;
    }

    public FlowTypeEnum getFlowTypeEnum() {
        return flowTypeEnum;
    }

    public void setFlowTypeEnum(FlowTypeEnum flowTypeEnum) {
        this.flowTypeEnum = flowTypeEnum;
    }
    public Integer getVersion() {
        return version;
    }

    public void setVersion(Integer version) {
        this.version = version;
    }

    @Override
    public String toString() {
        return "FlowChain{" +
                "displayName='" + displayName + '\'' +
                ", name='" + name + '\'' +
                ", expression='" + expression + '\'' +
                ", version=" + version +
                ", order=" + order +
                ", url='" + url + '\'' +
                ", flowTypeEnum=" + flowTypeEnum +
                ", map=" + map.keySet() +
                '}';
    }
}

